package com.lipl.base.javaee.netty.nio;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;

/**
 * @Auther: 15541
 * @Date: 2020/10/31 21:17
 * @Description:
 */
public class NIOFileChannel04 {
    public static void main(String[] args) throws IOException {

        FileInputStream fileInputStream = new FileInputStream("d:\\DRG医院.pptx");
        FileOutputStream fileOutputStream = new FileOutputStream("d:\\DRG医院1.ppt");

        FileChannel sourceCh = fileInputStream.getChannel();
        FileChannel destCh = fileOutputStream.getChannel();

        destCh.transferFrom(sourceCh,0,sourceCh.size());

        sourceCh.close();
        destCh.close();
        fileInputStream.close();
        fileOutputStream.close();


    }
}

